/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-11-25 19:28:38  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.risk.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "WWYT_RISK_DISTRICT_EVALUATION")
@SQLDelete(sql = "update WWYT_RISK_DISTRICT_EVALUATION set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_RISK_DISTRICT_EVALUATION set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class RiskDistrictEvaluation implements java.io.Serializable {

    // columns START
    // ID
    private java.lang.Long id;
    // 风险区域ID
    // @NotNull(field = "风险分区")
    private java.lang.Long riskDistrictId;
    // 区域风险编号
    private java.lang.String code;
    // 区域风险等级

    private java.lang.Integer riskLevel;

    //校正等级
    private String reviseLevel;

    // 固有风险等级
   // @NotNull(field = "固有风险等级")
    @Min(value = 1)
    @Max(value = 4)
    private java.lang.Integer stableRiskLevel;
    // 固有风险L选项
    private java.lang.String stableRiskL;
    // 固有风险S选项
    private java.lang.String stableRiskS;
    // 责任部门
    // @NotNull(field = "责任部门")
    private java.lang.Long responsibleDepartId;
    // 责任人
    // @NotNull(field = "责任人")
    private java.lang.Long responsiblePersonId;
    // 评估人
    //@NotNull(field = "评估人")
    private java.lang.Long evaluationUserId;
    // 评估时间
    //@NotNull(field = "评估时间")
    private java.util.Date evaluationTime;
    // 评估单位
    // @NotNull(field = "评估单位")
    private java.lang.String evaluationOffice;
    // 有效
    private java.lang.Integer effective;
    // 创建人
    private java.lang.Long createBy;
    // 创建时间
    private java.util.Date createTime;
    // 更新人
    private java.lang.Long updateBy;
    // 更新时间
    private java.util.Date updateTime;
    // 删除标记
    private java.lang.String deleteFlag;
    // 组织机构代码
    private java.lang.String orgCode;
    // 租户
    private java.lang.Long tenentId;
    //固有风险评估id
    private java.lang.Long stableEvaluationId;
    // columns END


    public void setId(java.lang.Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public java.lang.Long getId() {
        return this.id;
    }

    @Column(name = "RISK_DISTRICT_ID")
    public java.lang.Long getRiskDistrictId() {
        return this.riskDistrictId;
    }

    public void setRiskDistrictId(java.lang.Long value) {
        this.riskDistrictId = value;
    }

    @Column(name = "CODE", length = 10)
    public java.lang.String getCode() {
        return this.code;
    }

    public void setCode(java.lang.String value) {
        this.code = value;
    }

    @Column(name = "RISK_LEVEL")
    public java.lang.Integer getRiskLevel() {
        return this.riskLevel;
    }

    public void setRiskLevel(java.lang.Integer value) {
        this.riskLevel = value;
    }

    @Column(name = "REVISE_LEVEL")
    public String getReviseLevel() {
        return reviseLevel;
    }

    public void setReviseLevel(String reviseLevel) {
        this.reviseLevel = reviseLevel;
    }

    @Column(name = "STABLE_RISK_LEVEL")
    public java.lang.Integer getStableRiskLevel() {
        return this.stableRiskLevel;
    }

    public void setStableRiskLevel(java.lang.Integer value) {
        this.stableRiskLevel = value;
    }

    @Column(name = "STABLE_RISK_L", length = 200)
    public java.lang.String getStableRiskL() {
        return this.stableRiskL;
    }

    public void setStableRiskL(java.lang.String value) {
        this.stableRiskL = value;
    }

    @Column(name = "STABLE_RISK_S", length = 200)
    public java.lang.String getStableRiskS() {
        return this.stableRiskS;
    }

    public void setStableRiskS(java.lang.String value) {
        this.stableRiskS = value;
    }

    @Column(name = "RESPONSIBLE_DEPART_ID")
    public java.lang.Long getResponsibleDepartId() {
        return this.responsibleDepartId;
    }

    public void setResponsibleDepartId(java.lang.Long value) {
        this.responsibleDepartId = value;
    }

    @Column(name = "RESPONSIBLE_PERSON_ID")
    public java.lang.Long getResponsiblePersonId() {
        return this.responsiblePersonId;
    }

    public void setResponsiblePersonId(java.lang.Long value) {
        this.responsiblePersonId = value;
    }

    @Column(name = "EVALUATION_USER_ID")
    public java.lang.Long getEvaluationUserId() {
        return this.evaluationUserId;
    }

    public void setEvaluationUserId(java.lang.Long value) {
        this.evaluationUserId = value;
    }

    @Column(name = "EVALUATION_TIME")
    public java.util.Date getEvaluationTime() {
        return this.evaluationTime;
    }

    public void setEvaluationTime(java.util.Date value) {
        this.evaluationTime = value;
    }

    @Column(name = "EVALUATION_OFFICE", length = 100)
    public java.lang.String getEvaluationOffice() {
        return this.evaluationOffice;
    }

    public void setEvaluationOffice(java.lang.String value) {
        this.evaluationOffice = value;
    }

    @Column(name = "EFFECTIVE")
    public java.lang.Integer getEffective() {
        return this.effective;
    }

    public void setEffective(java.lang.Integer value) {
        this.effective = value;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public java.lang.Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(java.lang.Long value) {
        this.createBy = value;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public java.lang.Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(java.lang.Long value) {
        this.updateBy = value;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public java.lang.String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(java.lang.String value) {
        this.deleteFlag = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public java.lang.String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(java.lang.String value) {
        this.orgCode = value;
    }

    @Column(name = "TENENT_ID")
    public java.lang.Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(java.lang.Long value) {
        this.tenentId = value;
    }

    @Column(name = "STABLE_EVALUATION_ID")
    public java.lang.Long getStableEvaluationId() {
        return this.stableEvaluationId;
    }

    public void setStableEvaluationId(java.lang.Long value) {
        this.stableEvaluationId = value;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
                .append("riskDistrictId", getRiskDistrictId()).append("code", getCode())
                .append("riskLevel", getRiskLevel()).append("stableRiskLevel", getStableRiskLevel())
                .append("stableRiskL", getStableRiskL()).append("stableRiskS", getStableRiskS())
                .append("responsibleDepartId", getResponsibleDepartId())
                .append("responsiblePersonId", getResponsiblePersonId())
                .append("evaluationUserId", getEvaluationUserId()).append("evaluationTime", getEvaluationTime())
                .append("evaluationOffice", getEvaluationOffice()).append("effective", getEffective())
                .append("createBy", getCreateBy()).append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime())
                .append("deleteFlag", getDeleteFlag()).append("orgCode", getOrgCode()).append("tenentId", getTenentId())
                .append("stableEvaluationId",getStableEvaluationId()).toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof RiskDistrictEvaluation == false)
            return false;
        if (this == obj)
            return true;
        RiskDistrictEvaluation other = (RiskDistrictEvaluation) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
